﻿@model blacksoft.Models.Reserva
@{
    ViewBag.Title = "ReserveConfirmation";
    Layout = "~/Views/Shared/_LayoutVentas.cshtml";
}

@*Depuración*@
@if (null != TempData["alertMessage"])
{
    <script type="text/javascript">
        alert("@TempData["alertMessage"]");
    </script>
}

<div class="block big">
    <div class="titlebar">
        <h3>Nueva Venta</h3>
    </div>
    <div class="block_cont">

        <h4>Reserva Nro: <a style="color:red">@Html.Display("IDReserva")</a></h4>
        <hr />


        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()
            <div class="form">

                @Html.LabelFor(model => model.FechaRegistro)

                @Html.TextBoxFor(model => model.FechaRegistro, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })

                @Html.LabelFor(model => model.FechaLimite)

                @Html.TextBoxFor(model => model.FechaLimite, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })

                @Html.LabelFor(model => model.FechaSalida)

                @Html.TextBoxFor(model => model.FechaSalida, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })

                @Html.LabelFor(model => model.FechaRetorno)

                @Html.TextBoxFor(model => model.FechaRetorno, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })

                @Html.LabelFor(model => model.Estado)

                @Html.TextBoxFor(model => model.Estado, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })

            </div>

            <div style="margin-top:15px">
                <div class="titlebar">
                    <h3>Pasajes de la Reserva</h3>
                </div>
                <table class="data-table">
                    <thead>
                        <tr>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().DNI)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().ApellidoPaterno)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().ApellidoMaterno)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().Nombre)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().NroAsiento)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().Refrigerio)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Pasaje.First().Almuerzo)
                            </th>
                        </tr>
                    </thead>

                    @foreach (var item in Model.Pasaje)
                    {

                        <tr>
                            <td>
                                @Html.DisplayFor(model => item.DNI, item.DNI)
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.ApellidoPaterno, item.ApellidoPaterno)
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.ApellidoMaterno, item.ApellidoMaterno)
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.Nombre, item.Nombre)
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.NroAsiento, item.NroAsiento.ToString())
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.Refrigerio, item.Refrigerio)
                            </td>
                            <td>
                                @Html.DisplayFor(model => item.Almuerzo, item.Almuerzo)
                            </td>
                        </tr>
                    }
                </table>
            </div>
            <div class="form-row">
                <input type="submit" value="Confirmar" class="btn btn-default" />
                <br />
                @Html.ActionLink("Regresar", "Create")
            </div>

        }
    </div>
</div>